package Code.Day2_20240919.com.dx.day02;


/**
 * @ClassName Test01
 * @Description 循环练习
 * @Author 12994
 * @Date 2024/9/19 10:46
 * @Version 1.0
 **/
public class Test01 {
    public static void main(String[] args) {
        int i = 1;
        while (i <= 100) {
            System.out.println("抄写了" + i + "遍");
            i++;
        }

        /*
        每天检查张昊的学习任务是否合格，如果不合格则继续进行。
         */
        double score;
        do {
            // make study
            score = Math.random();
            System.out.printf("study: %.6f\n", score);
        }
        while (score <= 0.8);
        System.out.printf("Finished!!: %.6f\n", score);

        for (int j = 0; j < 5; j++) {
            System.out.println("*****");
        }

        for (int j = 0; j < 5; j++) {
            for (int k = 5; k > j; k--) {
                System.out.print(" ");
            }
            System.out.println("*****");
        }

        for (int j = 0; j < 6; j++) {
            for (int k = 5; k > j; k--) {
                System.out.print(" ");
            }
            for (int k = 0; k < 2 * j - 1; k++) {
                System.out.print("*");
            }
            System.out.println();

        }
        for (int j = 5 - 1; j > 0; j--) {
            for (int k = 0; k < 5 - j; k++) {
                System.out.print(" ");
            }
            for (int k = 2 * j - 1; k > 0; k--) {
                System.out.print("*");
            }
            System.out.println();
        }
    }
}
